/*
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 */
using VOL.Core.BaseProvider;
using VOL.Entity.DomainModels;
using VOL.Core.Utilities;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace VOL.demo.IServices
{
    public partial interface IstoragelocationmodelService : IService<storagelocationmodel>
    {
        /// <summary>
        /// 添加库位
        /// </summary>
        /// <param name="storageLocation">库位信息</param>
        /// <returns>操作结果</returns>
        Task<WebResponseContent> AddStorageLocationAsync(storagelocationmodel storageLocation);

        /// <summary>
        /// 更新库位
        /// </summary>
        /// <param name="storageLocation">库位信息</param>
        /// <returns>操作结果</returns>
        Task<WebResponseContent> UpdateStorageLocationAsync(storagelocationmodel storageLocation);

        /// <summary>
        /// 删除库位
        /// </summary>
        /// <param name="id">库位ID</param>
        /// <returns>操作结果</returns>
        Task<WebResponseContent> DeleteStorageLocationAsync(int id);

        /// <summary>
        /// 批量删除库位
        /// </summary>
        /// <param name="ids">库位ID列表</param>
        /// <returns>操作结果</returns>
        Task<WebResponseContent> BatchDeleteStorageLocationAsync(List<int> ids);

        /// <summary>
        /// 根据ID获取库位信息
        /// </summary>
        /// <param name="id">库位ID</param>
        /// <returns>库位信息</returns>
        Task<storagelocationmodel> GetStorageLocationByIdAsync(int id);

        /// <summary>
        /// 检查库位编号是否已存在
        /// </summary>
        /// <param name="locationCode">库位编号</param>
        /// <param name="excludeId">排除的ID（用于编辑时检查）</param>
        /// <returns>是否存在</returns>
        Task<bool> IsLocationCodeExistsAsync(string locationCode, int? excludeId = null);

        /// <summary>
        /// 获取库位分页列表
        /// </summary>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageSize">每页记录数</param>
        /// <param name="keyword">搜索关键词</param>
        /// <param name="warehouseId">仓库ID</param>
        /// <param name="locationState">库位状态</param>
        /// <returns>分页结果</returns>
        Task<(List<storagelocationmodel> Data, int TotalCount)> GetStorageLocationPagedAsync(
            int pageIndex = 1, 
            int pageSize = 20, 
            string keyword = null, 
            long? warehouseId = null, 
            string locationState = null);

        /// <summary>
        /// 批量修改库位
        /// </summary>
        /// <param name="dto">批量修改DTO</param>
        /// <returns>操作结果</returns>
        Task<WebResponseContent> BatchUpdateStorageLocationAsync(BatchUpdateStorageLocationDto dto);

        /// <summary>
        /// 批量修改库位的仓库ID
        /// </summary>
        /// <param name="dto">批量修改仓库DTO</param>
        /// <returns>操作结果</returns>
        Task<WebResponseContent> BatchUpdateWarehouseIdAsync(BatchUpdateWarehouseDto dto);
    }
}
